package net.zabuchy.helper;

import java.util.Formatter;

import org.springframework.util.DigestUtils;

public class PasswordHelper {
	
	public static String encodePassword(String password) {
		
		byte[] pass = password.getBytes();
    	byte[] md5pass = DigestUtils.md5Digest(pass);
    	Formatter formatter = new Formatter();
    	for(byte digestByte : md5pass) {
    		formatter.format("%02x", digestByte);
    	}
    	
    	return formatter.toString();

	}
	
	
}